//
// Created by 11510 on 2024/6/19.
//
#include <iostream>
class Mother {
public:
    virtual void MotherFoo() { printf("Mother - %p\n", this); }
    void simple() { printf("Simple - %p\n", this); }
    virtual void MotherFoo2() { printf("Mother222 - %p\n", this); }
};

class Father {
public:
    virtual void FatherFoo() {
        printf("Father\n");
    }
    double father;
};

class Child : public Mother, public Father {
public:
    void MotherFoo() override { printf("MotherFoo Child - %p\n", this); }

    void simple() { printf("Simple - %p\n", this); }

    void FatherFoo() override{
        printf("Child Father\n");
    }
};

int main(){
    Mother *mother = new Child();
//    mother->simple();
//    mother->MotherFoo();
    printf("%ld\n", sizeof(*mother));

    Father* father = dynamic_cast<Father*>(mother);
//    Father* father = (Father*)mother;
    father->FatherFoo();
    printf("%ld\n", sizeof(*father));
    delete mother;
    return 0;
}